

using System;
using System.Text;

using NHibernate;
using NHibernate.Cfg;
using NHibernate.Criterion;
using NHibernate.Exceptions;

using NuevoGenNHibernate.EN.Ebay;
using NuevoGenNHibernate.CAD.Ebay;

namespace NuevoGenNHibernate.CEN.Ebay
{
public partial class ArticuloCEN
{
private IArticuloCAD _IArticuloCAD;

public ArticuloCEN(IArticuloCAD _IArticuloCAD)
{
        this._IArticuloCAD = _IArticuloCAD;
}

public IArticuloCAD get_IArticuloCAD ()
{
        return this._IArticuloCAD;
}

public int CrearArticulo (string p_Nombre, NuevoGenNHibernate.Enumerated.Ebay.CategoriaEnum p_Categoria)
{
        ArticuloEN articuloEN = null;
        int oid;

        //Initialized ArticuloEN
        articuloEN = new ArticuloEN ();
        articuloEN.Nombre = p_Nombre;

        articuloEN.Categoria = p_Categoria;

        //Call to ArticuloCAD

        oid = _IArticuloCAD.CrearArticulo (articuloEN);
        return oid;
}

public void ModificarArticulo (int p_Articulo_OID, string p_Nombre, NuevoGenNHibernate.Enumerated.Ebay.CategoriaEnum p_Categoria)
{
        ArticuloEN articuloEN = null;

        //Initialized ArticuloEN
        articuloEN = new ArticuloEN ();
        articuloEN.Id_articulo = p_Articulo_OID;
        articuloEN.Nombre = p_Nombre;
        articuloEN.Categoria = p_Categoria;
        //Call to ArticuloCAD

        _IArticuloCAD.ModificarArticulo (articuloEN);
}

public void EliminarArticulo (int id_articulo)
{
        _IArticuloCAD.EliminarArticulo (id_articulo);
}

public ArticuloEN ReadOID (int id_articulo)
{
        ArticuloEN articuloEN = null;

        articuloEN = _IArticuloCAD.ReadOID (id_articulo);
        return articuloEN;
}

public System.Collections.Generic.IList<ArticuloEN> ReadAll (int first, int size)
{
        System.Collections.Generic.IList<ArticuloEN> list = null;

        list = _IArticuloCAD.ReadAll (first, size);
        return list;
}
}
}
